package cn.lanqiao.gateway.filter;


//@Component
//public class MyGlobalFilter implements GlobalFilter, Ordered {
//    @Override
//    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
//        boolean token = exchange.getRequest().getHeaders().containsKey("Authorization");
//        System.out.println("----全局过滤器token----"+token);
//        if (!token){
//            exchange.getResponse().setStatusCode(HttpStatus.UNAUTHORIZED);
//            ServerHttpResponse response = exchange.getResponse();
//            return response.setComplete();
//        }
//        return chain.filter(exchange);
//    }
//    @Override
//    public int getOrder() {
//        return 1;
//    }
//}
